#include "gus2.h"

enum
{
	EDatetime = 0x98,
	EDate = 0x44,
	ETime = 0x54,
	EYear = 0,
	EMon,
	EDay,
	EHour,
	EMin,
	ESec,
};
#if GUS2_ENABLE_ATTRI
const __gui_attr_sys_rtc CTRL_TYPE_SYS_ATTR = {
	/*.Datetime = */EDatetime,
	/*.Date =	  */EDate,
	/*.Time = 	  */ETime,
	/*.Year = 	  */EYear,
	/*.Mon  = 	  */EMon,
	/*.Day  = 	  */EDay,
	/*.Hour = 	  */EHour,
	/*.Min  = 	  */EMin,
	/*.Sec  = 	  */ESec,
};
#endif 
void gui_sys_rtc_set_datetime(bytearray_t* ba,
	unsigned char year, unsigned char mon, unsigned char day, 
	unsigned char hour, unsigned char min, unsigned char sec) {
	gui_ctrl_set_attrs(ba, "bbbbbbb", EDatetime, year, mon, day, hour, min, sec);
}
void gui_sys_rtc_set_date(bytearray_t* ba, unsigned char year, unsigned char mon, unsigned char day) {
	gui_ctrl_set_attrs(ba, "bbbb", EDate, year, mon, day);
}

void gui_sys_rtc_set_time(bytearray_t* ba, unsigned char hour, unsigned char min, unsigned char sec) {
	gui_ctrl_set_attrs(ba, "bbbb", ETime, hour, min, sec);
}
void gui_sys_rtc_set_year(bytearray_t* ba, unsigned char year) {
	gui_ctrl_set_attrs(ba, "bb", EYear, year);
}
void gui_sys_rtc_set_mon(bytearray_t* ba, unsigned char mon) {
	gui_ctrl_set_attrs(ba, "bb", EMon, mon);
}
void gui_sys_rtc_set_day(bytearray_t* ba, unsigned char day) {
	gui_ctrl_set_attrs(ba, "bb", EDay, day);
}
void gui_sys_rtc_set_hour(bytearray_t* ba, unsigned char hour) {
	gui_ctrl_set_attrs(ba, "bb", EHour, hour);
}
void gui_sys_rtc_set_min(bytearray_t* ba, unsigned char min) {
	gui_ctrl_set_attrs(ba, "bb", EMin, min);
}
void gui_sys_rtc_set_sec(bytearray_t* ba, unsigned char sec) {
	gui_ctrl_set_attrs(ba, "bb", ESec, sec);
}

